import { request } from "./index";

request.interceptors.request.use((config) => {
  return config;
});

request.interceptors.response.use(
  (response) => {
    if(response.data.code === 200){
        return response.data.data
    }else{
        return Promise.reject({message:response.data.message})
    }   
  },
  (error) => {
    return Promise.reject(error)
  }
);

export default request;
